package com.boxing.filter;

import javax.servlet.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebFilter(filterName = "Filter2", urlPatterns = "/*")
public class Filter2 implements Filter {
    public void init(FilterConfig config) throws ServletException {
        System.out.println("Filter2 init");
    }

    public void destroy() {
        System.out.println("Filter2 destroy");
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException {
        System.out.println("Filter2 chain.doFilter 之前");
        chain.doFilter(request, response);
        System.out.println("Filter2 chain.doFilter 之后");

    }
}
